package com.higgins.eventtracking.server.dataModel;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.higgins.eventtracking.client.dto.FinanceGoalDTO;

@PersistenceCapable
public class FinanceGoal {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String goal;
	
	@Persistent
	private Double price;
	
	@Persistent
	private Integer priority;

	public FinanceGoal(FinanceGoalDTO dto)	{
		this.goal = dto.getGoal();
		this.price = dto.getPrice();
		this.priority = dto.getPriority();
	}
	public FinanceGoal()	{
		
	}
	public void setGoal(String goal)	{
		this.goal = goal;
	}
	public String getGoal()	{
		return goal;
	}
	public void setPrice(Double price)	{
		this.price = price;
	}
	public Double getPrice()	{
		return price;
	}
	public void setPriority(Integer priority)	{
		this.priority = priority;
	}
	public Integer getPriority()	{
		return priority;
	}
	public FinanceGoalDTO toDTO()	{
		FinanceGoalDTO goalDTO = new FinanceGoalDTO();
		goalDTO.setGoal(goal);
		goalDTO.setPrice(price);
		return goalDTO;
	}
}
